home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / PCI.a < prev    next >
Text File  |  1996-05-01  |  7KB  |  316 lines

  1. ;
  2. ;    File:        PCI.a
  3. ;
  4. ;    Contains:    PCI Bus Interfaces.
  5. ;
  6. ;    Version:    Technology:    PowerSurge 1.0.2
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__PCI__') = 'UNDEFINED' THEN
  19. __PCI__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__NAMEREGISTRY__') = 'UNDEFINED' THEN
  25.     include 'NameRegistry.a'
  26.     ENDIF
  27.     IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
  28. ;  Types and structures for accessing the PCI Assigned-Address property.
  29.  
  30. kPCIRelocatableSpace            EQU        $80
  31. kPCIPrefetchableSpace            EQU        $40
  32. kPCIAliasedSpace                EQU        $20
  33. kPCIAddressTypeCodeMask            EQU        $03
  34. kPCIConfigSpace                    EQU        0
  35. kPCIIOSpace                        EQU        1
  36. kPCI32BitMemorySpace            EQU        2
  37. kPCI64BitMemorySpace            EQU        3
  38. ; typedef UInt8                         PCIAddressSpaceFlags
  39.  
  40.  
  41. kPCIDeviceNumberMask            EQU        $1F
  42. kPCIFunctionNumberMask            EQU        $07
  43. ; typedef UInt8                         PCIDeviceFunction
  44.  
  45. ; typedef UInt8                         PCIBusNumber
  46.  
  47. ; typedef UInt8                         PCIRegisterNumber
  48.  
  49. PCIAssignedAddress        RECORD 0
  50. addressSpaceFlags         ds.b    1                ; offset: $0 (0)
  51. busNumber                 ds.b    1                ; offset: $1 (1)
  52. deviceFunctionNumber     ds.b    1                ; offset: $2 (2)
  53. registerNumber             ds.b    1                ; offset: $3 (3)
  54. address                     ds        UnsignedWide    ; offset: $4 (4)
  55. size                     ds        UnsignedWide    ; offset: $C (12)
  56. sizeof                     EQU *                    ; size:   $14 (20)
  57.                         ENDR
  58. ; typedef struct PCIAssignedAddress *    PCIAssignedAddressPtr
  59.  
  60.     IF ¨ GENERATINGCFM THEN
  61.         Macro
  62.         _EndianSwap32Bit &Dn
  63.             IF &Dn = '' THEN
  64.                 ROL.W    #8,D0
  65.                 SWAP    D0
  66.                 ROL.W    #8,D0
  67.             ELSE
  68.                 ROL.W    #8,&Dn
  69.                 SWAP    &Dn
  70.                 ROL.W    #8,&Dn
  71.             ENDIF
  72.         Endm
  73.     ELSE
  74.         IMPORT_CFM_FUNCTION    EndianSwap32Bit
  75.     ENDIF
  76.  
  77.     IF ¨ GENERATINGCFM THEN
  78.         Macro
  79.         _EndianSwap16Bit &Dn
  80.             IF &Dn = '' THEN
  81.                 ROL.W    #8,D0
  82.             ELSE
  83.                 ROL.W    #8,&Dn
  84.             ENDIF
  85.         Endm
  86.     ELSE
  87.         IMPORT_CFM_FUNCTION    EndianSwap16Bit
  88.     ENDIF
  89.  
  90.     ENDIF
  91.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  92. ;
  93. ; pascal OSErr ExpMgrConfigReadByte(RegEntryIDPtr node, LogicalAddress configAddr, UInt8 *valuePtr)
  94. ;
  95.     IF ¨ GENERATINGCFM THEN
  96.         Macro
  97.         _ExpMgrConfigReadByte
  98.             move.w              #$0620,D0
  99.             dc.w                $AAF3
  100.         EndM
  101.     ELSE
  102.         IMPORT_CFM_FUNCTION ExpMgrConfigReadByte
  103.     ENDIF
  104.  
  105. ;
  106. ; pascal OSErr ExpMgrConfigReadWord(RegEntryIDPtr node, LogicalAddress configAddr, UInt16 *valuePtr)
  107. ;
  108.     IF ¨ GENERATINGCFM THEN
  109.         Macro
  110.         _ExpMgrConfigReadWord
  111.             move.w              #$0621,D0
  112.             dc.w                $AAF3
  113.         EndM
  114.     ELSE
  115.         IMPORT_CFM_FUNCTION ExpMgrConfigReadWord
  116.     ENDIF
  117.  
  118. ;
  119. ; pascal OSErr ExpMgrConfigReadLong(RegEntryIDPtr node, LogicalAddress configAddr, UInt32 *valuePtr)
  120. ;
  121.     IF ¨ GENERATINGCFM THEN
  122.         Macro
  123.         _ExpMgrConfigReadLong
  124.             move.w              #$0622,D0
  125.             dc.w                $AAF3
  126.         EndM
  127.     ELSE
  128.         IMPORT_CFM_FUNCTION ExpMgrConfigReadLong
  129.     ENDIF
  130.  
  131. ;
  132. ; pascal OSErr ExpMgrConfigWriteByte(RegEntryIDPtr node, LogicalAddress configAddr, UInt8 value)
  133. ;
  134.     IF ¨ GENERATINGCFM THEN
  135.         Macro
  136.         _ExpMgrConfigWriteByte
  137.             move.w              #$0523,D0
  138.             dc.w                $AAF3
  139.         EndM
  140.     ELSE
  141.         IMPORT_CFM_FUNCTION ExpMgrConfigWriteByte
  142.     ENDIF
  143.  
  144. ;
  145. ; pascal OSErr ExpMgrConfigWriteWord(RegEntryIDPtr node, LogicalAddress configAddr, UInt16 value)
  146. ;
  147.     IF ¨ GENERATINGCFM THEN
  148.         Macro
  149.         _ExpMgrConfigWriteWord
  150.             move.w              #$0524,D0
  151.             dc.w                $AAF3
  152.         EndM
  153.     ELSE
  154.         IMPORT_CFM_FUNCTION ExpMgrConfigWriteWord
  155.     ENDIF
  156.  
  157. ;
  158. ; pascal OSErr ExpMgrConfigWriteLong(RegEntryIDPtr node, LogicalAddress configAddr, UInt32 value)
  159. ;
  160.     IF ¨ GENERATINGCFM THEN
  161.         Macro
  162.         _ExpMgrConfigWriteLong
  163.             move.w              #$0625,D0
  164.             dc.w                $AAF3
  165.         EndM
  166.     ELSE
  167.         IMPORT_CFM_FUNCTION ExpMgrConfigWriteLong
  168.     ENDIF
  169.  
  170. ;
  171. ; pascal OSErr ExpMgrIOReadByte(RegEntryIDPtr node, LogicalAddress ioAddr, UInt8 *valuePtr)
  172. ;
  173.     IF ¨ GENERATINGCFM THEN
  174.         Macro
  175.         _ExpMgrIOReadByte
  176.             move.w              #$0626,D0
  177.             dc.w                $AAF3
  178.         EndM
  179.     ELSE
  180.         IMPORT_CFM_FUNCTION ExpMgrIOReadByte
  181.     ENDIF
  182.  
  183. ;
  184. ; pascal OSErr ExpMgrIOReadWord(RegEntryIDPtr node, LogicalAddress ioAddr, UInt16 *valuePtr)
  185. ;
  186.     IF ¨ GENERATINGCFM THEN
  187.         Macro
  188.         _ExpMgrIOReadWord
  189.             move.w              #$0627,D0
  190.             dc.w                $AAF3
  191.         EndM
  192.     ELSE
  193.         IMPORT_CFM_FUNCTION ExpMgrIOReadWord
  194.     ENDIF
  195.  
  196. ;
  197. ; pascal OSErr ExpMgrIOReadLong(RegEntryIDPtr node, LogicalAddress ioAddr, UInt32 *valuePtr)
  198. ;
  199.     IF ¨ GENERATINGCFM THEN
  200.         Macro
  201.         _ExpMgrIOReadLong
  202.             move.w              #$0628,D0
  203.             dc.w                $AAF3
  204.         EndM
  205.     ELSE
  206.         IMPORT_CFM_FUNCTION ExpMgrIOReadLong
  207.     ENDIF
  208.  
  209. ;
  210. ; pascal OSErr ExpMgrIOWriteByte(RegEntryIDPtr node, LogicalAddress ioAddr, UInt8 value)
  211. ;
  212.     IF ¨ GENERATINGCFM THEN
  213.         Macro
  214.         _ExpMgrIOWriteByte
  215.             move.w              #$0529,D0
  216.             dc.w                $AAF3
  217.         EndM
  218.     ELSE
  219.         IMPORT_CFM_FUNCTION ExpMgrIOWriteByte
  220.     ENDIF
  221.  
  222. ;
  223. ; pascal OSErr ExpMgrIOWriteWord(RegEntryIDPtr node, LogicalAddress ioAddr, UInt16 value)
  224. ;
  225.     IF ¨ GENERATINGCFM THEN
  226.         Macro
  227.         _ExpMgrIOWriteWord
  228.             move.w              #$052A,D0
  229.             dc.w                $AAF3
  230.         EndM
  231.     ELSE
  232.         IMPORT_CFM_FUNCTION ExpMgrIOWriteWord
  233.     ENDIF
  234.  
  235. ;
  236. ; pascal OSErr ExpMgrIOWriteLong(RegEntryIDPtr node, LogicalAddress ioAddr, UInt32 value)
  237. ;
  238.     IF ¨ GENERATINGCFM THEN
  239.         Macro
  240.         _ExpMgrIOWriteLong
  241.             move.w              #$062B,D0
  242.             dc.w                $AAF3
  243.         EndM
  244.     ELSE
  245.         IMPORT_CFM_FUNCTION ExpMgrIOWriteLong
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal OSErr ExpMgrInterruptAcknowledgeReadByte(RegEntryIDPtr entry, UInt8 *valuePtr)
  250. ;
  251.     IF ¨ GENERATINGCFM THEN
  252.         Macro
  253.         _ExpMgrInterruptAcknowledgeReadByte
  254.             move.w              #$0411,D0
  255.             dc.w                $AAF3
  256.         EndM
  257.     ELSE
  258.         IMPORT_CFM_FUNCTION ExpMgrInterruptAcknowledgeReadByte
  259.     ENDIF
  260.  
  261. ;
  262. ; pascal OSErr ExpMgrInterruptAcknowledgeReadWord(RegEntryIDPtr entry, UInt16 *valuePtr)
  263. ;
  264.     IF ¨ GENERATINGCFM THEN
  265.         Macro
  266.         _ExpMgrInterruptAcknowledgeReadWord
  267.             move.w              #$0412,D0
  268.             dc.w                $AAF3
  269.         EndM
  270.     ELSE
  271.         IMPORT_CFM_FUNCTION ExpMgrInterruptAcknowledgeReadWord
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal OSErr ExpMgrInterruptAcknowledgeReadLong(RegEntryIDPtr entry, UInt32 *valuePtr)
  276. ;
  277.     IF ¨ GENERATINGCFM THEN
  278.         Macro
  279.         _ExpMgrInterruptAcknowledgeReadLong
  280.             move.w              #$0413,D0
  281.             dc.w                $AAF3
  282.         EndM
  283.     ELSE
  284.         IMPORT_CFM_FUNCTION ExpMgrInterruptAcknowledgeReadLong
  285.     ENDIF
  286.  
  287. ;
  288. ; pascal OSErr ExpMgrSpecialCycleWriteLong(RegEntryIDPtr entry, UInt32 value)
  289. ;
  290.     IF ¨ GENERATINGCFM THEN
  291.         Macro
  292.         _ExpMgrSpecialCycleWriteLong
  293.             move.w              #$0419,D0
  294.             dc.w                $AAF3
  295.         EndM
  296.     ELSE
  297.         IMPORT_CFM_FUNCTION ExpMgrSpecialCycleWriteLong
  298.     ENDIF
  299.  
  300. ;
  301. ; pascal OSErr ExpMgrSpecialCycleBroadcastLong(UInt32 value)
  302. ;
  303.     IF ¨ GENERATINGCFM THEN
  304.         Macro
  305.         _ExpMgrSpecialCycleBroadcastLong
  306.             move.w              #$021A,D0
  307.             dc.w                $AAF3
  308.         EndM
  309.     ELSE
  310.         IMPORT_CFM_FUNCTION ExpMgrSpecialCycleBroadcastLong
  311.     ENDIF
  312.  
  313.     ENDIF
  314.     ENDIF ; __PCI__ 
  315.  
  316.